﻿using System.Data;
using AuctionSite.DAL;
using AuctionSite.Entities;
using AuctionSite.Utils;

namespace AuctionSite.BL
{
    public class SubCategoriaService
    {
        public DataTable BuscaSubCategoriaPorCategoria(decimal categoriaId)
        {
            return SQL.GetDataTableBySQL(string.Format("SELECT * FROM subcategorias WHERE cat_id = {0}", categoriaId));
        }

        public DataTable BuscaTodasSubCategorias()
        {
            return SQL.GetDataTableBySQL("SELECT * FROM subcategorias");
        }

        public SubCategoria Incluir(SubCategoria subCategoria)
        {
            SubCategoriaDAL scdal = new SubCategoriaDAL();
            return scdal.Incluir(subCategoria);
        }
    }
}